<?php
/**
 * Created by PhpStorm.
 * User: 雷里雷
 * Date: 2019/3/14
 * Time: 22:44
 */

namespace App\Policies;

use App\Models\Comment;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class CommentPolicy
{
    use HandlesAuthorization;

    public function delete(User $user, Comment $comment)
    {
        return ($comment->user_id == $user->id or $comment->chapter->user_id == $user->id);
    }
}